<?php use_helper('Javascript','Nifty') ?>

<h2>Auto Complete</h2>
<?php echo input_auto_complete_tag('searchbox', '', 'demo/autocomplete',array('autocomplete'=>'off'),'use_style=true'); ?>
<br /><br />
<h2>Sortable List & In-Place Editor</h2>
<div id="ordered_list">
  <?php foreach ($students as $student): ?>
    <div id="student_<?php echo $student->getId() ?>" class="student">
      <div class="handle">DRAG</div>
      <div class="studentdetails">
        <div id="studentname_<?php echo $student->getId() ?>"><?php echo $student->getName(); ?></div>
        <?php echo input_in_place_editor_tag('studentname_'.$student->getId(),'demo/editname?id='.$student->getId(), array('cols' => 40, 'rows' => 1,)) ?>
      </div>
    </div>
  <?php endforeach; ?>
</div>
<div id="feedback" class="feedback"></div>

<?php echo sortable_element('ordered_list', array(
                            'url'        => 'demo/ajaxsort',
                            'handle'     => 'handle',
                            'only'       => 'student',
                            'update'     => 'feedback',
                            'hoverclass' => 'hovered',
                            'tag'        => 'div',
                            'loading'    => "Element.show('indicator')",
                            'complete'   => "Element.hide('indicator')",
                            'success'    => visual_effect('highlight','feedback'),
	)) ?>
<?php echo javascript_tag( nifty_round_elements("div.student") ) ?>